<%--
  Created by IntelliJ IDEA.
  User: FHL
  Date: 2020/12/14
  Time: 14:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>$Title$</title>
    <script src="${pageContext.request.contextPath}/script/jquery-1.7.2.min.js"></script>
    <script>
      function a() {
        $.post({
          url:"${pageContext.request.contextPath}/a1",
          /*"name"是从后端取来的数据*/
          data:{"name":$("#username").val()},
        success:function (data,status) {
                  console.log("data="+data);
                  console.log("status="+status);//200,300,400,500
        },
          error:function () {

          }
                })
      }
    </script>
  </head>
  <body>
<%--失去焦点时，发起一个请求(携带信息)到后台--%>
  用户名：<input type="text" id="username" onblur="a()">
  </body>
</html>
